<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"         
      xmlns:ui="http://java.sun.com/jsf/facelets">

    <h:body>
        <ui:composition template="/templates/templateNECS.xhtml">

            <ui:define name="top">
                Funcionário de Balcão - Vendas 
            </ui:define>

            <ui:define name="left">
                <h:form>
                    <h:commandLink value="Criar Venda" action="#{funcBalcaoManager.criarVenda()}"/> 
                    <br></br>
                    <h:outputLink value="funcionarioBalcao_produtos.xhtml">Lista de Produtos</h:outputLink>
                    <br></br>
                    <h:outputLink value="./../index.xhtml">Logout</h:outputLink>
                </h:form>
            </ui:define>     

            <ui:define name="content">
                <h:form>
                    <h:dataTable
                        var="venda"
                        summary="Lista de todos as vendas"
                        value="#{funcBalcaoManager.vendas}"
                        rules="all"
                        cellpadding="5">
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="Id" />
                            </f:facet>
                            <h:commandLink action="#{funcBalcaoManager.goToVenda(venda.id)}">#{venda.id}</h:commandLink>
                        </h:column>>

                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="Fechada?" />
                            </f:facet>
                            <h:outputText value="#{venda.fechada}" />
                        </h:column>

                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="Data" />
                            </f:facet>
                            <h:outputText value="#{venda.dataVenda}" />
                        </h:column>                        
                    </h:dataTable>
                </h:form>
            </ui:define>   
        </ui:composition>
    </h:body>
</html>